<?php echo $this->element('user'); ?>
<div class="aTitle">
	<h2>Courses</h2>
</div>
<div class="assessment">
	<div class="aToolbar">
		<span class="aToolbarButton">
			<span class="iconNew"></span>
			<a href="/courses/add" title="Add New Course">Add New Course</a>
		</span>
	</div>
<fieldset>

<div class="aTable">
	<div class="aTableHeader">
		<span class="aTableDelete">Delete</span>
		<span class="aTableEdit">Edit</span>
		<span class="aTableCourse">Course</span>
	</div>
	<?php  ?>
<?php 
	$i = 0;//switch between 1 and 0 to toggle between the two list classes
foreach ($courses as $course){ 
	$questiongroups = '';

	if($i == 0)
	{
		$questiongroups .=  '<div class="aTableRowA">';
		$i = 1;
	}
	else
	{
		$questiongroups .=  '<div class="aTableRowB">';
		$i = 0;
	}

	echo $questiongroups;
	print '
	<span class="aTableDelete">
		<a href="javascript:checkDelete(\'/courses/delete/'.$course['Course']['id'].'\');">
		<span class="iconDelete"></span></a>
	</span>
	<span class="aTableEdit">
		<a href="/courses/edit/'.$course['Course']['id'].'">
		<span class="iconEdit"></span></a>
	</span>
	<span class="aTableCaption">
		<a href="/courses/edit/'.$course['Course']['id'].'">'.$course['Course']['name'].'
		&nbsp;-&nbsp;'.$course['Course']['description'].'</a>
	</span>
	</div>
	';
}
?>
</fieldset>
</div>